home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import sys
- import gobject
- gobject.threads_init()
- import pygst
- pygst.require('0.10')
- import gst
- mainloop = gobject.MainLoop()
-
- def on_eos(bus, msg):
- mainloop.quit()
-
-
- def filter(input, output):
- '''A GStreamer copy pipeline which can add arbitrary filters'''
- bin = gst.parse_launch('filesrc name=source ! ' + 'filesink name=sink')
- filesrc = bin.get_by_name('source')
- filesrc.set_property('location', input)
- filesink = bin.get_by_name('sink')
- filesink.set_property('location', output)
- bus = bin.get_bus()
- bus.add_signal_watch()
- bus.connect('message::eos', on_eos)
- bin.set_state(gst.STATE_PLAYING)
-
- try:
- mainloop.run()
- except KeyboardInterrupt:
- pass
-
- bin.set_state(gst.STATE_NULL)
-
-
- def main(args):
- '''A GStreamer based cp(1) with stats'''
- if len(args) != 3:
- print 'usage: %s source dest' % sys.argv[0]
- return -1
- return filter(args[1], args[2])
-
- if __name__ == '__main__':
- sys.exit(main(sys.argv))
-
-